<template>
  <van-tabbar :route="true" v-model="active" active-color="#ee0a24">
    <van-tabbar-item name="home" to="/home" icon="home-o">首页</van-tabbar-item>
    <van-tabbar-item name="cate" to="/cate" icon="apps-o">分类</van-tabbar-item>
    <van-tabbar-item name="cart" to="/cart" icon="shopping-cart-o" :badge="!$store.is_login ? '' : $store.cartList.length ">购物车</van-tabbar-item>
    <van-tabbar-item name="self" to="/self" icon="user-o" :dot="!$store.is_login">{{ $store.is_login? '我的' : '未登录' }}</van-tabbar-item>
  </van-tabbar>
</template>
<script setup lang="ts">
import useUserStore from '../store/user'
import { ref, onMounted } from 'vue';
const active = ref<string>('home')
const $store = useUserStore() as any

onMounted( () => {
  $store.fn()
})
console.log($store)
</script> 
<style scoped lang="scss">
</style>